<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript">
  $(document).ready(function() {
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#password").formValidator({empty:true,onshow:"不修改密码请留空。",onfocus:"密码应该为6-20位之间"}).inputValidator({min:6,max:20,onerror:"密码应该为6-20位之间"});
	$("#pwdconfirm").formValidator({empty:true,onshow:"不修改密码请留空。",onfocus:"请输入两次密码不同。",oncorrect:"密码输入一致"}).compareValidator({desid:"password",operateor:"=",onerror:"请输入两次密码不同。"});
	$("#email").formValidator({onshow:"请输入E-mail",onfocus:"E-mail格式错误",oncorrect:"E-mail格式正确"}).regexValidator({regexp:"email",datatype:"enum",onerror:"E-mail格式错误"});
  })
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="<?php echo U('manage/edit');?>" method="post" id="myform">
<input type="hidden" name="info[id]" value="<?php echo $user['id']?>"/>
<table width="100%" class="table_form contentWrap">
<tr>
<td width="80">用户名</td> 
<td><?php echo $user['username']?></td>
</tr>
<tr>
<td>密码</td> 
<td><input type="password" name="info[password]" id="password" class="input-text"/></td>
</tr>
<tr>
<td>确认密码</td> 
<td><input type="password" name="info[pwdconfirm]" id="pwdconfirm" class="input-text"/></td>
</tr>
<tr>
<td>E-mail</td>
<td>
<input type="text" name="info[email]" value="<?php echo $user['email']?>" class="input-text" id="email" size="30"/>
</td>
</tr>
<tr>
<td>真实姓名</td>
<td>
<input type="text" name="info[realname]" value="<?php echo $user['realname']?>" class="input-text" id="realname"/>
</td>
</tr>
<tr>
<td>状态</td>
<td>
<input name="info[display]" value="1" type="radio"  <?php echo $user['display']==1 ? ' checked' : ''?>> 开启    <input name="info[display]" value="0"  type="radio"  <?php echo $user['display']==0 ? ' checked' : ''?> /> 禁用

</td>
</tr>
<tr>
<td>所属角色</td>
<td>
<select name="info[roleid]">
<?php 
if(isset($roles) && $roles){
	foreach($roles as $role){
?>
<option value="<?php echo $role['id']?>" <?php echo (($role['id']==$user['roleid']) ? 'selected' : '')?>><?php echo $role['rolename']?></option>
<?php 
}	}
?>
</select>
</td>
</tr>
</table>

    <div class="bk15"></div>
    <input name="dosubmit" type="submit" value="提交" class="dialog" id="dosubmit">
</form>
</div>
</div>
</body>
</html>